﻿<%@ Page Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master"  AutoEventWireup="true" CodeBehind="VideoProductList.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.VideoProductList" %>

<%@ Import Namespace="ZLCMS.Business.Util" %>
<%@ Register src="~/Wap/Shop/Footer.ascx" tagname="Footer" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>V品汇·实地考察 品质保证</title>
    <style type="text/css">
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">
<!--S page -->
<div data-role="page" id="mypage" class="VideoProductList">
	
    <!--S content -->
	<div role="main" class="ui-content loaderHandler storedefault">
        <div class="videoListBox">
            <ul id="videoList">
            </ul>
            <div style="display:none">
                <button id="btnMore" data-icon="refresh" style="width: 95%; margin-left: auto; margin-right: auto;">显示更多</button>
            </div>
        </div>

 	</div>
    <!--E content -->
   <%-- <button id="btnMore" data-icon="refresh" style="width: 95%; margin-left: auto; margin-right: auto; display: block;" class=" ui-btn ui-icon-refresh ui-btn-icon-left ui-shadow ui-corner-all">显示更多</button>--%>
    <!--S footer -->
	<div data-role="footer" data-position="fixed" data-tap-toggle="false">
            <uc1:Footer ID="Footer1" runat="server" />
    </div>
    <!--E footer -->
</div>
<!--E page -->

<%--<script src="/wap/lib/common/loaderHandler.js" type="text/javascript"></script>--%>


<script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
<script type="text/javascript">

    var _emptyHtml = ' <div class="f-fs-62 f-tac" style="color:#666; margin-top:1.2rem">-- 暂时没有相关资讯！ --</br></div>';
    function LoadVideoList() {
        var handler = $('#videoList').listviewHandler();
//        var PageSize = 0;
//        var PageIndex = 10;
        handler.initialize({
            loaderBtn: $('#btnMore'),  //加载数据按钮（点击加载下一页）
            emptyHtml: _emptyHtml, //无记录时显示此html
            itemTemplate: ' <li pid="{Id}">'
                   + ' <div class="fl videoList">'
                   + '     <a href="VideoProductDetail.aspx?pid={Id}">'
                   + '         <img src="{ThumbnailUrl}" />'
                   + '     </a>'
                   + '     <i class="videoIcon"></i>'
                   + ' </div>'
                   + ' <div class="fl videoInfo">'
                   + '     <p>{Title}</p>'
                   + '     <p>{Summary}</p>'
                   + '     <p class="uptime">{CreateDate}</p>'
                   + ' </div>'
                + '</li>', //项模板
            pageIndex: 1, //页码（从1起算）
            pageSize: 10, //页大小
            totalCount: 999, //总记录数
            itemHandler: function (data, itemTemplate, container) {//数据各项处理
                data.CreateDate = (data.CreateDate).substring(0, 10);
                data.ThumbnailUrl = firstThumbnail(data.ThumbnailUrl);
                return itemTemplate.format(data);
            },
            afterHandleResult: function (result, totalCount, container) {
                $("li").click(function () {
                    location.href = "VideoProductDetail.aspx?pid=" + $(this).attr("pid");
                });
            },

            command: 'Pub.LoadArticleList',
            parameter: { Kind:"videoPro" }
        });
        handler.nextPage();
    };




    $(function () {
        // initializePage();
        LoadVideoList();
        $(".title").width();

            $(window).scroll(function () {
                //当内容滚动到底部时加载新的内容

                if ($(this).scrollTop() + $(window).height() + 20 >= $(document).height() && $(this).scrollTop() > 20) {
                    //当前要加载的页码
                    $('#btnMore').click();
                }
            });

    });
</script>

</asp:Content>
